using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input.Touch;

namespace ShipkaDefenders.Screens
{
    class ScreenTitle : Screen
    {
        public ScreenTitle(AnaLogic game){ g = game; }
        float fader = 0;
        public override void Update(TimeSpan gt, TimeSpan elapsed)
        {
            fader = ((float)gt.TotalMilliseconds / (3*400000)) * 60;
            if (gt.Seconds > 3 || GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)
            {
                g.ChangeState(ScreenState.Menu);
            }
        }
        public override void Draw(SpriteBatch sb)
        {
            sb.Begin(SpriteSortMode.Immediate, BlendState.NonPremultiplied);
            sb.Draw(g.MapTextures["project_splash_1"], Vector2.Zero, new Color(255, 100, 255, fader));
            sb.DrawString(g.MapFonts["Rockwell24"], "HEAVY METAL RAKIA", new Vector2(200, 200), Color.White);
            sb.DrawString(g.MapFonts["Rockwell24"], "       Game Studios\nUnwillingly presents...", new Vector2(200, 240), Color.Orange);
        }
        public override void Gestures(TimeSpan gt, GestureSample gs)
        {
            switch (gs.GestureType)
            {
                case GestureType.Tap:
                    g.ChangeState(ScreenState.Menu);
                    break;
            }
        }
    }
}
